# 安装Apache HTTPD
install_httpd:
  pkg.installed:
    - name: httpd  # RHEL/CentOS包名，Debian/Ubuntu请改为apache2

# 配置测试页面
/var/www/html/index.html:
  file.managed:
    - source: salt://services/files/var/www/html/index.html
    - user: root
    - group: root
    - mode: 644
    - template: jinja # 使用jinja模板
    - require:
      - pkg: install_httpd

# 启动服务
start_httpd:
  service.running:
    - name: httpd
    - enable: True
    - watch:
      - file: /var/www/html/index.html
